home *** CD-ROM | disk | FTP | other *** search
- freeze = _root.freeze;
- heroe = _root.heroe;
- SPEED = 20;
- balaObj = {_x:30,_y:170,dx:20,dy:0,mover:true};
- if(freeze._xscale > 0)
- {
- balaObj._x = freeze._x + 30;
- }
- else
- {
- balaObj._x = freeze._x - 30;
- balaObj.dx *= -1;
- }
- balaObj._y = freeze._y - 30;
- teta = Math.atan(Math.abs(heroe._x - balaObj._x) / Math.abs(heroe._y - balaObj._y));
- balaObj.dx = freeze._xscale <= 0 ? -1 * SPEED * Math.sin(teta) : SPEED * Math.sin(teta);
- balaObj.dy = SPEED * Math.cos(teta);
- _root.bala.duplicateMovieClip("balaX",1,balaObj);
-